import request from '@/utils/request'
/** **
 * 快递员列表数据查询
 * ***/

export function getDeliveryman(params) {
  return request({
    url: '/manager/business-hall/courier/page',
    method: 'get',
    params
  })
}

/** **
 * 司机列表数据查询
 * ***/

export function getChauffeur(params) {
  return request({
    url: '/manager/driver/page',
    method: 'get',
    params
  })
}

/** **
 * 排班列表数据查询
 * ***/

export function getGrade(params) {
  return request({
    url: '/manager/work-schedulings',
    method: 'get',
    params
  })
}

/** **
 * 获取所属机构树状机构信息
 * ***/

export function getOrganization(params) {
  return request({
    url: '/manager/business-hall/tree',
    method: 'get',
    params
  })
}
/** **
 * 获取工作模式树状机构信息
 * ***/

export function getSchema(params) {
  return request({
    url: '/manager/work-patterns/all',
    method: 'get',
    params
  })
}

// 获取司机基本信息详情
export function getDriver(id) {
  return request({
    url: `/manager/driver/${id}`
  })
}

// 获取司机驾驶证信息
export function getDriving(id) {
  return request({
    url: `/manager/driverLicense/${id}`
  })
}

// 保存司机信息
export function keepApi(data, id) {
  return request({
    url: `/manager/driver/${id}`,
    method: 'put',
    data
  })
}
// 保存司机驾驶证信息
export function drivingApi(data) {
  return request({
    url: `/manager/driverLicense`,
    method: 'post',
    data
  })
}

// 机构相关接口

export function getSetList(params) {
  return request({
    url: '/manager/work-patterns/page',
    params
  })
}

export function delSetList(id) {
  return request({

    url: `/manager/work-patterns/${id}`,
    method: 'DELETE',
    params: { id }
  })
}
